
#ifndef WIDGET_DRAW_H
#define WIDGET_DRAW_H

#include "gkt_widget.h"
#include "gkt_font.h"
#include "gkt_text.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(GKT_CONFIG_SCREEN_ENABLE) && GKT_CONFIG_SCREEN_ENABLE

#include "gkt_screen.h"

__STATIC_INLINE 
void widget_draw_clear(gkt_widget_s *widget, 
				int update)
{
	gkt_screen_fill(GKT_WIDGET_RECT_PTR(widget), 
		GKT_WIDGET_BG_COLOR(widget), update);
}

void widget_draw_background(gkt_widget_s *widget, 
				gkt_rect_s *rect, int focus, int update);

void widget_draw_underline(gkt_widget_s *widget, 
				int update);

void widget_draw_border(gkt_widget_s *widget, 
				int update);

void widget_draw_text(gkt_widget_s *widget, 
				gkt_rect_s *rect, const char *text, 
				uint32_t character_nums, 
				int focus, int update);

__STATIC_INLINE 
void widget_draw_update(gkt_widget_s *widget)
{
	gkt_screen_update(GKT_WIDGET_RECT_PTR(widget));
}

#endif

#ifdef __cplusplus
}
#endif

#endif	/* WIDGET_DRAW_H */

